// 初始化结束后触发
// window.onload(testMessage)

// 向背景程序发送一条数据
function testMessage(key) {
    console.log('id ====> ', key)
    chrome.runtime.sendMessage({
        key
    }, function (response) {
        console.log('content get response:', response);
    });
}

chrome.runtime.onMessage.addListener((request, sender, resp) => {
    console.log('request ===> ', request)
    console.log('sender ===> ', sender)
    resp(2)
})